package com.zk.shop.servlet.order;

import com.zk.shop.entity.Goods;
import com.zk.shop.entity.Order;
import com.zk.shop.entity.User;
import com.zk.shop.service.Impl.OrderServiceImpl;
import com.zk.shop.service.OrderService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @ClassName DelOrderServlet
 * @Description TODO
 * @Author 李帅
 * @Date 2019/9/29 0029 下午 4:55
 * @Version 1.0
 **/
@WebServlet("DelOrderServlet")
public class DelOrderServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        int orderId= Integer.parseInt(req.getParameter("orderId"));

        Order order=new Order();
        order.setOrderId(orderId);
        OrderService orderService=new OrderServiceImpl();
        boolean flag=orderService.delOrder(order);
        System.out.println(flag);
        PrintWriter out=resp.getWriter();
        out.print(flag);

    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req,resp);
    }
}
